package com.zbkc.main.base;

import com.zbkc.main.R;
import com.zbkc.util.MyApplication;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

public class BaseTabActivity extends BaseControlActivity implements
		OnClickListener {

	public static final int SUCCESS_MESSAGE = 1;
	public String BEIFEN = "我的备份";
	public String GONGXIANG = "我的共享";
	public String TONGBU = "我的同步";
	public String WENJIAN = "文件保险箱";
	private FrameLayout flContent;
	private ImageView ivLeft;
	private ImageView ivRight;
	public String statue = null;
	private TextView tvTitle;

	private void bindView() {
		this.ivLeft = ((ImageView) findViewById(R.id.iv_left));
		this.ivLeft.setOnClickListener(this);
		this.ivRight = ((ImageView) findViewById(R.id.iv_right));
		this.ivRight.setOnClickListener(this);
		this.flContent = ((FrameLayout) findViewById(R.id.fl_content_container));
		this.tvTitle = ((TextView) findViewById(R.id.tv_title));
	}

	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.iv_left:
			finish();
			break;
		}

	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		requestWindowFeature(1);
		super.setContentView(R.layout.activity_base_tab);
		MyApplication.getInstance().addTabActivity(this);
		bindView();
	}

	public void setBtn1Visiable(boolean paramBoolean) {
		if (!paramBoolean)
			this.ivLeft.setVisibility(4);
	}

	public void setBtn2Visiable(boolean paramBoolean) {
		if (!paramBoolean)
			this.ivRight.setVisibility(4);
	}

	public void setContentView(int paramInt) {
		View localView = getLayoutInflater().inflate(paramInt, null);
		this.flContent.removeAllViews();
		this.flContent.addView(localView, new ViewGroup.LayoutParams(-1, -1));
	}

	public void setContentView(View paramView) {
		this.flContent.removeAllViews();
		this.flContent.addView(paramView, new ViewGroup.LayoutParams(-1, -1));
	}

	public void setTitle(String paramString) {
		this.tvTitle.setText(paramString);
	}

}
